<template>
	<h4>用户 - 【 修改密码 】</h4>
	<hr >
	<table style="line-height: 36px;">
		<tr>
			<td>请输入原密码：</td>
			<td><input type="password" v-model="data.pwd.oldPwd"></td>
		</tr>
		
		<tr>
			<td>请输入新密码：</td>
			<td><input type="password" v-model="data.pwdNew"></td>
		</tr>
		<tr>
			<td>请确认新密码：</td>
			<td><input type="password" v-model="data.pwd.newPwd"></td>
		</tr>
		<tr>
			<td></td>
			<td><button @click="doUpdatePwd()">确认</button></td>
		</tr>
	</table>
</template>

<script setup>
	 import {ref ,reactive ,onMounted } from "vue"
	 import {$get ,$postx}from "../../ajax/index.js"
	 import myalert from "../../utils/myalert.js"
	 
	 const data = reactive({
		 pwd :{oldPwd :'',newPwd :''},
		 pwdNew :'',
	 })
	 
	 const doUpdatePwd =()=>{
		 console.log("用户更改密码");console.log(data.pwd);
		 
		 $postx("/api/user/updatePwd",data.pwd
		 ).then((resp)=>{
			 console.log(resp.data);
			 myalert(resp.data.msg)
		 })
	 }
</script>

<style>
	
</style>
